//package cn.flying.cloud.esb.core.camel.process;
//
//import org.apache.camel.Exchange;
//import org.apache.camel.Processor;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import cn.flying.cloud.base.common.utils.Ft;
//import cn.flying.cloud.esb.core.camel.constants.CamelConstant;
//import cn.flying.cloud.esb.core.enums.ErrorCodeEnum;
//import cn.flying.cloud.esb.core.exception.EsbException;
//import cn.flying.cloud.esb.model.ApiRequest;
//import cn.flying.cloud.esb.model.ApiRespData;
//import cn.flying.cloud.esb.model.ApiResponse;
//
///**
// * @author: admin
// * @date: 2025年04月12日 17:08
// * @version: 1.0
// */
//@Component
//public class HttpMethodProcessor implements Processor {
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    /**
//     * Processes the message exchange
//     *
//     * @param exchange the message exchange
//     * @throws Exception if an internal processing error has occurred.
//     */
//    @Override
//    public void process(Exchange exchange) throws Exception {
//        String method = exchange.getIn().getHeader(Exchange.HTTP_METHOD, String.class);
//        // 只接收POST类型
//        if (!"POST".equalsIgnoreCase(method)) {
//            logger.warn("不支持的HTTP method: " + method);
//            throw new EsbException(ErrorCodeEnum.E_1001);
//        }
//
//        // 解析转换请求参数对象
//        byte[] bytes = (byte[]) exchange.getIn().getBody();
//        String body = new String(bytes);
//        ApiRequest request = Ft.JSON.deserialize(body, ApiRequest.class);
//        exchange.setProperty(CamelConstant.API_REQUEST, request);
//
//        ApiResponse response = new ApiResponse();
//
//        ApiRespData respData = new ApiRespData();
//
//        respData.setHead(request.getRequest().getHead());
////        respData.setBody();
//        respData.setSign("");
//
//
//        response.setResponse(respData);
//
//
//    }
//}
